home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / mail / pine3.96.tar.gz / pine3.96.tar / pine3.96 / imap / ANSI / c-client / phile.h < prev    next >
C/C++ Source or Header  |  1994-03-02  |  6KB  |  139 lines

  1. /*
  2.  * Program:    File routines
  3.  *
  4.  * Author:    Mark Crispin
  5.  *        Networks and Distributed Computing
  6.  *        Computing & Communications
  7.  *        University of Washington
  8.  *        Administration Building, AG-44
  9.  *        Seattle, WA  98195
  10.  *        Internet: MRC@CAC.Washington.EDU
  11.  *
  12.  * Date:    25 August 1993
  13.  * Last Edited:    2 March 1994
  14.  *
  15.  * Copyright 1994 by the University of Washington
  16.  *
  17.  *  Permission to use, copy, modify, and distribute this software and its
  18.  * documentation for any purpose and without fee is hereby granted, provided
  19.  * that the above copyright notice appears in all copies and that both the
  20.  * above copyright notice and this permission notice appear in supporting
  21.  * documentation, and that the name of the University of Washington not be
  22.  * used in advertising or publicity pertaining to distribution of the software
  23.  * without specific, written prior permission.  This software is made
  24.  * available "as is", and
  25.  * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
  26.  * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED
  27.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN
  28.  * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL,
  29.  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  30.  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT
  31.  * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION
  32.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  33.  *
  34.  */
  35.  
  36. /* Build parameters */
  37.  
  38.  
  39. /* Command bits from phile_getflags() */
  40.  
  41. #define fSEEN 1
  42. #define fDELETED 2
  43. #define fFLAGGED 4
  44. #define fANSWERED 8
  45.  
  46.  
  47. /* Types returned from phile_type() */
  48.  
  49. #define PTYPEBINARY 0        /* binary data */
  50. #define PTYPETEXT 1        /* textual data */
  51. #define PTYPECRTEXT 2        /* textual data with CR */
  52. #define PTYPE8 4        /* textual 8bit data */
  53. #define PTYPEISO2022JP 8    /* textual Japanese */
  54. #define PTYPEISO2022KR 16    /* textual Korean */
  55.  
  56.  
  57. /* PHILE I/O stream local data */
  58.     
  59. typedef struct phile_local {
  60.   ENVELOPE *env;        /* file envelope */
  61.   BODY *body;            /* file body */
  62.   char *buf;            /* buffer for message text */
  63.   char tmp[MAILTMPLEN];        /* temporary buffer */
  64. } PHILELOCAL;
  65.  
  66.  
  67. /* Convenient access to local data */
  68.  
  69. #define LOCAL ((PHILELOCAL *) stream->local)
  70.  
  71. /* Function prototypes */
  72.  
  73. DRIVER *phile_valid (char *name);
  74. int phile_isvalid (char *name,char *tmp);
  75. void *phile_parameters (long function,void *value);
  76. void phile_find (MAILSTREAM *stream,char *pat);
  77. void phile_find_bboards (MAILSTREAM *stream,char *pat);
  78. void phile_find_all (MAILSTREAM *stream,char *pat);
  79. void phile_find_all_bboards (MAILSTREAM *stream,char *pat);
  80. long phile_subscribe (MAILSTREAM *stream,char *mailbox);
  81. long phile_unsubscribe (MAILSTREAM *stream,char *mailbox);
  82. long phile_subscribe_bboard (MAILSTREAM *stream,char *mailbox);
  83. long phile_unsubscribe_bboard (MAILSTREAM *stream,char *mailbox);
  84. long phile_create (MAILSTREAM *stream,char *mailbox);
  85. long phile_delete (MAILSTREAM *stream,char *mailbox);
  86. long phile_rename (MAILSTREAM *stream,char *old,char *new);
  87. MAILSTREAM *phile_open (MAILSTREAM *stream);
  88. int phile_type (unsigned char *s,unsigned long i,unsigned long *j);
  89. void phile_close (MAILSTREAM *stream);
  90. void phile_fetchfast (MAILSTREAM *stream,char *sequence);
  91. void phile_fetchflags (MAILSTREAM *stream,char *sequence);
  92. ENVELOPE *phile_fetchstructure (MAILSTREAM *stream,long msgno,BODY **body);
  93. char *phile_fetchheader (MAILSTREAM *stream,long msgno);
  94. char *phile_fetchtext (MAILSTREAM *stream,long msgno);
  95. char *phile_fetchbody(MAILSTREAM *stream,long m,char *sec,unsigned long *len);
  96. void phile_setflag (MAILSTREAM *stream,char *sequence,char *flag);
  97. void phile_clearflag (MAILSTREAM *stream,char *sequence,char *flag);
  98. void phile_search (MAILSTREAM *stream,char *criteria);
  99. long phile_ping (MAILSTREAM *stream);
  100. void phile_check (MAILSTREAM *stream);
  101. void phile_expunge (MAILSTREAM *stream);
  102. long phile_copy (MAILSTREAM *stream,char *sequence,char *mailbox);
  103. long phile_move (MAILSTREAM *stream,char *sequence,char *mailbox);
  104. long phile_append (MAILSTREAM *stream,char *mailbox,char *flags,char *date,
  105.            STRING *message);
  106. void phile_gc (MAILSTREAM *stream,long gcflags);
  107.  
  108. char *phile_file (char *dst,char *name);
  109. short phile_getflags (MAILSTREAM *stream,char *flag);
  110. char phile_search_all (MAILSTREAM *stream,long msgno,char *d,long n);
  111. char phile_search_answered (MAILSTREAM *stream,long msgno,char *d,long n);
  112. char phile_search_deleted (MAILSTREAM *stream,long msgno,char *d,long n);
  113. char phile_search_flagged (MAILSTREAM *stream,long msgno,char *d,long n);
  114. char phile_search_keyword (MAILSTREAM *stream,long msgno,char *d,long n);
  115. char phile_search_new (MAILSTREAM *stream,long msgno,char *d,long n);
  116. char phile_search_old (MAILSTREAM *stream,long msgno,char *d,long n);
  117. char phile_search_recent (MAILSTREAM *stream,long msgno,char *d,long n);
  118. char phile_search_seen (MAILSTREAM *stream,long msgno,char *d,long n);
  119. char phile_search_unanswered (MAILSTREAM *stream,long msgno,char *d,long n);
  120. char phile_search_undeleted (MAILSTREAM *stream,long msgno,char *d,long n);
  121. char phile_search_unflagged (MAILSTREAM *stream,long msgno,char *d,long n);
  122. char phile_search_unkeyword (MAILSTREAM *stream,long msgno,char *d,long n);
  123. char phile_search_unseen (MAILSTREAM *stream,long msgno,char *d,long n);
  124. char phile_search_before (MAILSTREAM *stream,long msgno,char *d,long n);
  125. char phile_search_on (MAILSTREAM *stream,long msgno,char *d,long n);
  126. char phile_search_since (MAILSTREAM *stream,long msgno,char *d,long n);
  127. char phile_search_body (MAILSTREAM *stream,long msgno,char *d,long n);
  128. char phile_search_subject (MAILSTREAM *stream,long msgno,char *d,long n);
  129. char phile_search_text (MAILSTREAM *stream,long msgno,char *d,long n);
  130. char phile_search_bcc (MAILSTREAM *stream,long msgno,char *d,long n);
  131. char phile_search_cc (MAILSTREAM *stream,long msgno,char *d,long n);
  132. char phile_search_from (MAILSTREAM *stream,long msgno,char *d,long n);
  133. char phile_search_to (MAILSTREAM *stream,long msgno,char *d,long n);
  134.  
  135. typedef char (*search_t) (MAILSTREAM *stream,long msgno,char *d,long n);
  136. search_t phile_search_date (search_t f,long *n);
  137. search_t phile_search_flag (search_t f,char **d);
  138. search_t phile_search_string (search_t f,char **d,long *n);
  139.